package com.syg.scheduled;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author syg
 */
@Component
public class Task {
    private Logger logger = LoggerFactory.getLogger(getClass());

    private int i;

    @Scheduled(cron = "*/10 * * * * ?")
    public void execute() {
        logger.info("thread id:{},task execute times:{}", Thread.currentThread().getId(), i++);
    }
}
